﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manage/MasterPage.master" AutoEventWireup="true" CodeFile="MyAnswer.aspx.cs" Inherits="Manage_MyAnswer" %>
<%@ Register Src="~/Manage/CmsMessageBox.ascx" TagName="MessageBox" TagPrefix="cms" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            $('#<%=Save.ClientID %>').click(function () {
                var ds = [{ 'Controller': '#<%=Reply.ClientID %>',
                    'Type': 'R',
                    'ErrorMessage': '请输入您的答案。',
                    'Clear': true,
                    'Focus': true
                }];

                return Cms_ValidateForm(ds);
            });
        });
    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="body" Runat="Server">
    <cms:MessageBox ID="MessageBox" runat="server" />
    <div id="Content">
        <div class="Kind"><%=question.Kind %> - <%=question.Subject %> - <%=question.Course %></div>
        <div class="Question">
            <div class="Title"><%=question.Title %></div>
            <div class="Vector">
                <span class="Name"><%=question.Name %></span>
                <span class="Time">
                    <%
                        DateTime now = DateTime.Now;
                        DateTime old = question.Time;

                        if (string.Format("{0:yyyy-MM-dd}", now) == string.Format("{0:yyyy-MM-dd}", old))
                        {
                    %>
                    
                    今天 <%=string.Format("{0:HH:mm}", old)%>

                    <%
                        }
                        else
                        {
                    %>

                    <%=string.Format("{0:yyyy-MM-dd HH:mm}", old) %>

                    <%
                        }                        
                    %>
                </span>
            </div>
            <div style="clear: both"></div>
            <div class="Memo">
                <%=question.Memo %>
            </div>
        </div>

        <div class="Answers">
            <div class="Title">问题答案</div>
            <asp:ListView ID="RecordView" runat="server">
                <LayoutTemplate>
                    <div id="itemPlaceholder" runat="server"></div>
                </LayoutTemplate>
                <ItemTemplate>
                    <div id="Div1" class="Answer" runat="server"> 
                        <div class="Header">
                            <span class="Name"><%#Eval("Name") %></span>
                            <span class="Time"><%#Eval("Time") %></span>
                        </div>
                        <div class="Memo">
                            <%#Eval("Memo") %>
                        </div>
                        <div style="clear: both"></div>
                    </div>
                </ItemTemplate>
                <ItemSeparatorTemplate>
                    <div class="Separator"></div>
                </ItemSeparatorTemplate>
            </asp:ListView>
        </div>

        <div class="MyAnswer">
            <table cellpadding="0" cellspacing="0" width="100%">
                <tr style="height: 35px">
                    <td align="left">我的回答：</td>
                </tr>
                <tr>
                    <td align="center">
                        <asp:TextBox ID="Reply" runat="server" TextMode="MultiLine" Width="670px" Height="200px"></asp:TextBox>
                    </td>
                </tr>
                <tr style="height: 45px">
                    <td align="right">
                        <asp:Button ID="Save" runat="server" Text="提交" onclick="Save_Click" />&nbsp;&nbsp;
                        <a href='./NoReplyQuestion.aspx?qid=<%=Request.Params["qid"] %>'>不回答</a>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</asp:Content>

